﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using QzEbook.AccessObject;
using System.Collections.Generic;
using System.Text;
using QzEbook.Common;

public partial class admin_manager_UserList : System.Web.UI.UserControl
{
    private StringBuilder sb;
    protected void Page_Load(object sender, EventArgs e)
    {
        bindData();
    }

    private void bindData()
    {
        UserList userlist = new UserList();
        List<SiteUser> list = userlist.selectList();


        sb = new StringBuilder();
        sb.Append("<ul id='userList'>");
        foreach (SiteUser item in list)
        {
            sb.AppendFormat("<li class=\"{0}\">", item.LevelName);
            //sb.AppendFormat("<a href=\"?Uid={0}\" title=\"进入此用户电子书页面\">", item.Uid);
            sb.AppendFormat("<img src=\"../{0}\" title=\"头像\" />", Config.UserBookSavePath + "noset.gif");
            sb.Append("<ins>");
            sb.AppendFormat("<h3 title=\"userName\">用户: <a href=\"../user.xhtml?Uid={1}\" title=\"查看作者主页\">{0}</a></h3>", item.Name,item.Uid);
            sb.AppendFormat("<dd>等级: <select><option>{0}</option></select></dd>", item.LevelName);

            sb.AppendFormat("<dd>书数: {0}本/{1}本</dd>", item.GrossBooks,item.QuotaBooks);
            sb.AppendFormat("<dd>花费:{0}M/{1}M</dd>", item.Gross, item.Quota);
            sb.AppendFormat("<dd>QQ: {0}</dd>", item.Qq);
            sb.AppendFormat("<dd title=\"email\">邮件: {0}</dd>", item.Mail);
            
            sb.AppendFormat("<dd>注册日期: {0}</dd>", item.Date);
            sb.Append("</ins>");
           // sb.Append("</a>");
            sb.Append("</li>");
        }

        sb.Append("</ul>");
    }
    protected override void Render(HtmlTextWriter writer)
    {
        if(sb!=null){
            writer.Write(sb);
        }
        base.Render(writer);
    }
}
